﻿<div id="content-table-inner">
	<div id="table-content">
		<div style="margin:10px 0px">
		<?php
			echo $form->create(array(
				'id'		=> 'frm',
				'action'	=> 'index',
				'type'		=> 'post'
		));
		?>
            <div>
                <label><?php echo __('Search', true); ?></label>
                    <?php
                        echo @$form->input(
                                'sname',
                                array(
                                        'id'	=>  'sname',
                                        'name'	=>  'sname',
                                        'type'	=>	'text',
                                        'label'	=>	false,
                                        'div'	=>	false,
                                        'value' => 'Product name',
                                        'style' => 'width:200px; margin_right:10px;'
                                )
                        );
                        echo $form->input(
                                'reason',
                                array(
                                        'type'		=> 'select',
                                        'name'		=> 'reason',
                                        'id'		=> 'reason',
                                        'label'		=> false,
                                        'div'		=> false,
                                        'options'	=> $group,
                                        'default'	=> 'all'

                                )
                        );
                        echo $form->button("Search", array('style'=>'width:60px; height:24px;', 'type'=>'submit', 'id'=>'regSubmit'));
                   ?>
                </div>
  	</div>
	<script>
		$(function() {
			$("#sname").focus(function(){

					$("#sname").val('');
				}
			);

			$("#sname").blur(function(){
				if ($("#sname").val() == '') {
					$("#sname").val('T�n s?n ph?m');
				}
			}
			);
		});
	</script>
	<?php echo $session->flash(); ?>
	<form id="page" method="post" action="/products" enctype="application/x-www-form-urlencoded">
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">

		<tr>
			<th class="table-header-check"><a id="toggle-all" ></a> </th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('ID', true),'#'); ?></th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('Name(EN)', true),'#'); ?></th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('Name(VN)', true),'#'); ?></th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('Type', true),'#'); ?></th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('Image', true),'#'); ?></th>
			<th class="table-header-repeat line-left date"><?php echo $html->link(__('Date', true),'#'); ?></th>
			<th class="table-header-repeat line-left"><?php echo $html->link(__('Action', true),'#'); ?></th>
		</tr>
		<tbody>
			<?php foreach ($products as $item) {?>
			<tr>
				<td><input type="checkbox" value="<?php echo $item['Product']['id']; ?>" /></td>
				<td><?php echo $item['Product']['id']; ?></td>
				<td><?php echo $item['Product']['name_eng']; ?></td>
				<td><?php echo $item['Product']['name_vie']; ?></td>
				<td><?php echo $item['ProductType']['name_vie']; ?></td>
				<td><?php echo $html->image(IMG_URL .'products/'. $item['Product']['img'],array('style' => 'width:80px; height:64px; padding-right:10px;'))?></td>
				<td><?php echo $item['Product']['date']; ?></td>
				<td  class="options-width">
					<a href="<?php echo Router::url(array('controller' => 'products', 'action' => 'edit', 'id' => $item['Product']['id'])); ?>" title="Edit" class="icon-1 info-tooltip"></a>
					<a href="<?php echo Router::url(array('controller' => 'products', 'action' => 'del', 'id' => $item['Product']['id'])); ?>" title="Delete" class="icon-2 info-tooltip"></a>
				</td>
			</tr>
			<?php } ?>
		</tbody>
	</table>
	</form>
	</div>

	<div id="actions-box">
		<!--
		<?php echo $html->link(__('Delete', true),'#', array('class' => 'action-slider')); ?>
		-->
		<?php echo $html->link(__('Add New', true),'/products/edit', array('class' => 'action-slider')); ?>
		<div class="clear"></div>
	</div>
	<?php echo $this->element('page_nav');?>
</div>